/*    */ package com.zimbra.cs.milter;
/*    */ 
/*    */ import org.apache.mina.core.buffer.IoBuffer;
/*    */ import org.apache.mina.core.session.IoSession;
/*    */ import org.apache.mina.filter.codec.CumulativeProtocolDecoder;
/*    */ import org.apache.mina.filter.codec.ProtocolDecoderOutput;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ final class NioMilterDecoder
/*    */   extends CumulativeProtocolDecoder
/*    */ {
/*    */   public boolean doDecode(IoSession session, IoBuffer in, ProtocolDecoderOutput out)
/*    */   {
/* 28 */     if (!in.prefixedDataAvailable(4)) {
/* 29 */       return false;
/*    */     }
/* 31 */     int len = in.getInt();
/* 32 */     byte cmd = in.get();
/* 33 */     byte[] data = null;
/* 34 */     if (len > 1) {
/* 35 */       data = new byte[len - 1];
/* 36 */       in.get(data);
/*    */     }
/* 38 */     MilterPacket packet = new MilterPacket(len, cmd, data);
/* 39 */     out.write(packet);
/* 40 */     return true;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/milter/NioMilterDecoder.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */